<div class="right-sidebar-white">
    <div class="sidebar-header text-center">
        <!--<a href="#" class="<?php echo $this->type == 'all' ? 'active' : ''; ?>">All</a>-->
        <a href="<?php echo APPLICATION_URL; ?>/product/all" class="<?php echo $this->type == 'product' ? 'active' : ''; ?>">Products</a>
        <a href="<?php echo APPLICATION_URL; ?>/brand/all" class="<?php echo $this->type == 'brand' ? 'active' : ''; ?>">Brands</a>
    </div>

    <div class="siderbar-middle">
        <p class="searchtools-text">Search/Tools</p>
        <form class="navbar-form" action="<?php echo APPLICATION_URL ?>/<?php echo $this->type; ?>/all" role="search" method="post" style="padding-left:0;display:inline-block;width:100%;position:relative;">
            <input type="text" placeholder="Start typing..." name="text" value="<?php echo $this->search_text; ?>" class="col-md-12"/>
        </form>
    </div>

    <div class="sidebar-footer text-right">

        <div class="sidebar-menu">
            <?php
                if ($this->type == 'myaccount')
                {
                    ?>

                    <p><a href = "<?php echo APPLICATION_URL ?>/myaccount" class = "<?php echo $this->params['type'] == 'account' || empty($this->params['type']) ? 'active' : ''; ?>">INFO SETTINGS</a></p>
                    <p><a href="#" class="<?php echo $this->params['type'] == 'password'?'active' : ''; ?>">PASSWORD SETTINGS</a></p>
                    <p><a href="#" class="<?php echo $this->params['type'] == 'connection'?'active' : ''; ?>">CONNECTION SETTINGS</a></p>
                    <p><a href="<?php echo APPLICATION_URL ?>/myaccount/order" class="<?php echo $this->params['type'] == 'order'?'active' : ''; ?>">ORDER HISTORY</a></p>
                    <p><a href="#" class="<?php echo $this->params['type'] == 'reward'?'active' : ''; ?>">MY REWARDS</a></p>
                    <p><a href="<?php echo APPLICATION_URL ?>/index/logout" class="color-red">LOG OUT</a></p>

                    <?php
                }
                elseif ($this->type != 'product' && $this->type != 'myaccount')
                {
                    if (isset($this->name))
                    {
                        ?>
                        <p><a href="#">Filter By: <?php echo $this->name; ?></a></p>
                        <?php
                    }
                    else
                    {
                        ?>
                        <p style="height:33px;">&nbsp;</p>
                        <?php
                    }
                    ?>
        <!--<p><a href="<?php echo APPLICATION_URL ?>/brand/all?type=trend" class="<?php echo $this->params['type'] == 'trend' || empty($this->params['type']) ? 'active' : ''; ?>">All Trends(<?php echo $this->count['trends']; ?>)</a></p>-->
                    <p><a href="<?php echo APPLICATION_URL ?>/brand/all?type=product" class="<?php echo $this->params['type'] == 'product' || empty($this->params['type']) ? 'active' : ''; ?>">Products(<?php echo $this->count['products']; ?>)</a></p>
                    <p><a href="#" class="<?php echo $this->params['type'] == 'social' ? 'active' : ''; ?>">Social Feeds(<?php echo $this->count['social']; ?>)</a></p>
                    <?php
                }
                elseif ($this->subtype != 'all' && $this->type != 'myaccount')
                {
                    ?>

                    <p><a href="#" class="active">SHOPPING CART (<?php echo count($this->cartdata) && is_array($this->cartdata) ? count($this->cartdata) : '0'; ?> item)</a></p>
                    <div class="sidebar-product-list use-scroller">

                        <?php
                        if (is_array($this->cartdata) && count($this->cartdata))
                            foreach ($this->cartdata as $cartVal)
                            {
                                ?>
                                <div class="right-part pull-right">
                                    <img src="<?php echo PRODUCTS_PATH; ?>/<?php echo $cartVal['images']; ?>" alt="product thumbnail" style="width:36px;height:auto;">
                                </div>
                                <div class="left-part pull-right" style="width:80%;margin-bottom:10px;">
                                    <ul class="product-desc">
                                        <li><?php echo $cartVal['prod_name']; ?></li> 
                                        <li>Size: <?php echo $cartVal['product_size']; ?></li> 
                                        <li>Color: <?php echo $cartVal['product_color']; ?></li> 
                                        <li>QTY: <?php echo $cartVal['product_quantity']; ?>|$<?php echo $cartVal['price']; ?></li> 
                                    </ul>
                                </div>
                                <hr style="margin:5px 0;display:inline-block;width:100%;">
                                <?php
                            }
                        ?>
                    </div>
                    <?php
                }
                elseif ($this->subtype == 'all' && $this->type == 'product')
                {
                    ?>
                    <p style="height:33px;">&nbsp;</p>
                    <p><a href="<?php echo $this->url() . '?c=all'; ?>" class="<?php echo (empty($this->params['c']) && empty($this->params['s']) ) || $this->params['c'] == 'all' ? 'active' : ''; ?>">SHOP ALL</a></p>
                    <?php
                    foreach ($this->category as $cKey => $cVal)
                    {
                        $subCat = explode(",", $cVal['subcategories']);
                        ?>
                        <p><a class="<?php echo ($this->params['c'] == $cVal['cat_id'] || ( (in_array($this->params['s'], $subCat)) && ( (empty($this->params['c'])) || $this->params['c'] == $cVal['cat_id'] ) ) ) ? 'active' : ''; ?>" href="<?php echo $this->url() . '?' . addQueryString('c', $cVal['cat_id']); ?>">SHOP BY <?php echo strtoupper($cVal['cat_name']); ?> (<?php echo $cVal['_count'] == '1' && empty($cVal['rkn_prod_id']) ? '0' : $cVal['_count']; ?>)</a></p>
                        <?php
                    }
                }
            ?>
        </div>
        <?php
            if ($this->type != 'product' && $this->subtype != 'all')
            {
                ?>
                <!--                <div class="social-block text-right vertical-scroller">
                                    <p class="heading">Socials</p>
                                    <a href="#">Facebook</a>
                                    <a href="#">Twitter</a>
                                    <a href="#">Instagram</a>
                                    <a href="#">Youtube</a>
                                </div>-->
                <?php
            }
            elseif ($this->type == 'product' && $this->subtype == 'all')
            {
                @$colors = $this->params['color'];
                $colors = explode('|', $colors);
                ?>
                <div class="social-block product-filters text-right vertical-scroller" style="padding-top:0;">
                    <div class="colors filters">
                        <a href="<?php echo $this->url() . '?' . (in_array('White', $colors) ? removeQueryString('color', 'White') : addQueryString('color', 'White')); ?>" class="<?php echo in_array('White', $colors) ? 'active' : ''; ?> white" style="background-color:#fff;"></a>
                        <a href="<?php echo $this->url() . '?' . (in_array('Yellow', $colors) ? removeQueryString('color', 'Yellow') : addQueryString('color', 'Yellow')); ?>" class="<?php echo in_array('Yellow', $colors) ? 'active' : ''; ?> yelow" style="background-color: Yellow;"></a>
                        <a href="<?php echo $this->url() . '?' . (in_array('Orange', $colors) ? removeQueryString('color', 'Orange') : addQueryString('color', 'Orange')); ?>" class="<?php echo in_array('Orange', $colors) ? 'active' : ''; ?> orange" style="background-color: Orange;"></a>
                        <a href="<?php echo $this->url() . '?' . (in_array('Red', $colors) ? removeQueryString('color', 'Red') : addQueryString('color', 'Red')); ?>" class="<?php echo in_array('Red', $colors) ? 'active' : ''; ?> Red" style="background-color: Red;"></a>
                        <a href="<?php echo $this->url() . '?' . (in_array('Purple', $colors) ? removeQueryString('color', 'Purple') : addQueryString('color', 'Purple')); ?>" class="<?php echo in_array('Purple', $colors) ? 'active' : ''; ?> Purple" style="background-color: Purple;"></a>
                        <a href="<?php echo $this->url() . '?' . (in_array('Blue', $colors) ? removeQueryString('color', 'Blue') : addQueryString('color', 'Blue')); ?>" class="<?php echo in_array('Blue', $colors) ? 'active' : ''; ?> Blue" style="background-color: Blue;"></a>
                        <a href="<?php echo $this->url() . '?' . (in_array('Green', $colors) ? removeQueryString('color', 'Green') : addQueryString('color', 'Green')); ?>" class="<?php echo in_array('Green', $colors) ? 'active' : ''; ?> Green" style="background-color: Green;"></a>
                        <a href="<?php echo $this->url() . '?' . (in_array('Brown', $colors) ? removeQueryString('color', 'Brown') : addQueryString('color', 'Brown')); ?>" class="<?php echo in_array('Brown', $colors) ? 'active' : ''; ?> Brown" style="background-color: Brown;"></a>
                        <a href="<?php echo $this->url() . '?' . (in_array('Grey', $colors) ? removeQueryString('color', 'Grey') : addQueryString('color', 'Grey')); ?>" class="<?php echo in_array('Grey', $colors) ? 'active' : ''; ?> Grey" style="background-color: Grey;"></a>
                        <a href="<?php echo $this->url() . '?' . (in_array('Black', $colors) ? removeQueryString('color', 'Black') : addQueryString('color', 'Black')); ?>" class="<?php echo in_array('Black', $colors) ? 'active' : ''; ?> Black" style="background-color: Black;"></a>
                        <a href="<?php echo $this->url() . '?' . (in_array('Multi', $colors) ? removeQueryString('color', 'Multi') : addQueryString('color', 'Multi')); ?>" class="<?php echo in_array('Multi', $colors) ? 'active' : ''; ?> colorpicker-box">
                            <span style="background-color:#2476ec;"></span><span style="background-color:#2cb33b;"></span><span style="background-color:#fa1027;"></span><span style="background-color:#fb9100;"></span><span style="background-color:#9d66cd;"></span><span style="background-color:#242323;"></span><span style="background-color:#fdf930;"></span><span style="background-color:#a7622b;"></span><span style="background-color:#d8aec3;"></span><span></span>
                        </a>
                    </div>
                    <div class="filters sizes">
                        <p class="heading"><img class="dropdown-arrow" src="<?php echo IMAGES_PATH ?>/dropdown-arr.png"> SHOP BY SIZE</p>
                        <?php
                        $sizeArr = array('XS', 'S', 'M', 'L', 'XL', 6, 7, 7.5, 8, 8.5, 9, 9.5, 10.5, 11, 13, 12, 14, 10, 11.5, 'NA', 28, 30, 32, 34, 36, 38);
                        @$sizes = $this->params['size'];
                        $sizes = explode('|', $sizes);
                        foreach ($sizeArr as $sizeVal)
                        {
                            ?>
                            <a  href="<?php echo $this->url() . '?' . (in_array($sizeVal, $sizes) ? removeQueryString('size', $sizeVal) : addQueryString('size', $sizeVal)); ?>" class="<?php echo in_array($sizeVal, $sizes) ? 'active' : ''; ?> size-block"><?php echo $sizeVal; ?></a>
                            <?php
                        }
                        ?>
                    </div>
                    <div class="filters prices">
                        <p class="heading"><img class="dropdown-arrow" src="<?php echo IMAGES_PATH ?>/dropdown-arr.png"> SHOP BY PRICE</p>
                        <ul class="price-filter" style="margin:0;padding:0;">
                            <li><a href="<?php echo $this->url() . '?' . addQueryString('price', '0-10'); ?>" style="display:inline-block;margin-top:0;"><input type="checkbox" value="0-10" <?php echo $this->params['price'] == '0-10' ? 'checked="checked"' : ''; ?>></a> $10 and under</li>
                            <li><a href="<?php echo $this->url() . '?' . addQueryString('price', '10-20'); ?>" style="display:inline-block;margin-top:0;"><input type="checkbox" value="10-20" <?php echo $this->params['price'] == '10-20' ? 'checked="checked"' : ''; ?>></a> $10 - $20</li>
                            <li><a href="<?php echo $this->url() . '?' . addQueryString('price', '20-30'); ?>" style="display:inline-block;margin-top:0;"><input type="checkbox" value="20-30" <?php echo $this->params['price'] == '20-30' ? 'checked="checked"' : ''; ?>></a> $20 - $30</li>
                        </ul>
                    </div>
                </div>
                <?php
            }
            else
            {
                if (count($this->cartdata) > 0 && is_array($this->cartdata))
                {
                    ?>
                    <div class="checkout_group">
                        ORDER SUB-TOTAL: <strong><?php echo $this->cartdata[0]['total_price']; ?></strong>
                        <!--<button class="btn btn-checkout-1 btn-block">PROCEED TO CHECKOUT</button>-->
                        <a href="<?php echo $this->baseUrl('cart/checkoutpaypal/shipping_code/01'); ?>" class="btn btn-checkout-2 btn-block">PROCEED TO CHECKOUT</a>
                    </div>
                    <?php
                }
            }
        ?>
    </div>
</div>